const getters = {
  sidebar: state => state.app.sidebar,
  device: state => state.app.device,
  token: state => state.user.token,
  visitedViews: state => state.tagsView.visitedViews,
  cachedViews: state => state.tagsView.cachedViews,
  avatar: state => state.user.avatar,
  msg: state => state.app.msg,
  name: state => {
    if (state.user.name) {
      state.user.name = localStorage.getItem("name");
    }
    return state.user.name;
  },
  role: state => {
    if (state.user.role) {
      state.user.role = parseInt(localStorage.getItem("role"));
    }
    return state.user.role;
  },
  permission: state => {
    if (state.user.permission) {
      state.user.role = parseInt(localStorage.getItem("permission"));
    }
    return state.user.permission;
  },
  subjects: state => {
    return state.user.subjects;
  }
};
export default getters
